// $Id$

using System;
using Salamanca;
using Salamanca.DataAccess.Collections;
using Salamanca.DataActivities;
using Northwind.DomainModel.Activities;

namespace Northwind.Activities
{

    public class OrderCreateNewActivity<TActivityData>:
        ActivityState<TActivityData>,
        IActivityInitialState
        where TActivityData:
            OrderCreateNew.IData
    {

        public OrderCreateNewActivity(TActivityData data, OrderCreateNew.IParameters parameters):
            base(data, parameters)
        {
        }

        protected override ActivityStateResult Handle(IActivityController controller)
        {
            return ActivityStateResult.Next;
        }

        protected override IActivityState NextState
        {
            get
            {
                return OrderCreateNew
                    .NextStateProvider<TActivityData>
                    .CreateCustomerAskInfosState(
                        Data,
                        (OrderCreateNew.IParameters)Parameters
                );
            }
        }

    }

    public sealed class OrderCreateNewActivity:
        OrderCreateNewActivity<OrderCreateNew.Data>
    {

        public OrderCreateNewActivity(OrderCreateNew.Parameters parameters):
            base(new OrderCreateNew.Data(), parameters)
        {
        }

    }

}
